<template>
  <el-dialog :title="dialogProps.title" :visible.sync="dialogProps.visible" width="700px"
    @open="handleDialogOpen()" v-loading="loading">
    <div slot="title" class="dialog-header">基本信息</div>
    <div>
      <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000"><span>姓名:</span></el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">身份证:</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12">{{memberDy.name}}</el-col>
        <el-col :span="12">{{memberDy.idCard}}</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000">邮箱:</el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">电话:</el-col>
      </el-row>

       <el-row :span="10">
        <el-col :span="12">{{memberDy.email}}</el-col>
        <el-col :span="12">{{memberDy.phoneNumber}}</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000">性别:</el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">年龄:</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12">{{memberDy.sex=="0"?"男":"女"}}</el-col>
        <el-col :span="12">{{memberDy.age}}</el-col>
      </el-row>
       <el-divider></el-divider>
    </div>
    <div style="color:#000000;margin-top:20px" class="dialog-body"><h3>{{ dialogProps.title }}</h3></div>

     <div style="margin-top:20px">
       <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000">体重:</el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">身高:</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.weight}}</el-col>
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.height}}</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000">体温:</el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">呼吸:</el-col>
      </el-row>

       <el-row :span="10">
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.thermometer}}</el-col>
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.breth}}</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000">腰围:</el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">臀围:</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.waistline}}</el-col>
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.hipline}}</el-col>
      </el-row>

       <el-row :span="10">
        <el-col :span="12" style="font-weight:bolder;color:#000000">收缩压:</el-col>
        <el-col :span="12" style="font-weight:bolder;color:#000000">舒张压:</el-col>
      </el-row>

      <el-row :span="10">
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.sbp}}</el-col>
        <el-col :span="12">{{memberDy.tMemberDynamicinfo.dbp}}</el-col>
      </el-row>
    </div>

     <span slot="footer" class="dialog-footer">
      <el-button size="small" type="primary" @click="handleDialogClose()">返回</el-button>
    </span>
    </el-dialog>
</template>

<script>
import {queryDynamicinfo} from "@/api/luowuwen/member"
export default {
  name: 'showDyinfo',
  data(){
    return{
      loading:false,
      memberDy:{
        idCard:"",
        phoneNumber:"",
        name:"",
        email:"",
        age:"",
        sex:"",
        tMemberDynamicinfo:{
            height:"",
            weight:"",
            dbp:"",     //舒张压
            sbp:"",    //收缩压
            breth:"",     //呼吸
            thermometer:"", //体温
            waistline:"", //腰围
            hipline:""
        }
      },
      dialogProps: {
          visible: false,
          action: '',
          title: ''
        }
    }
  },
  methods:{
    async initmemberinfo(id){
        try{
            let[MemberDys]=await Promise.all([
              queryDynamicinfo(id)
            ])
            console.log(MemberDys.data)
            this.memberDy=MemberDys.data;
        }catch(error){
          console.error;
        }
      },
      handleDialogClose() {
      this.dialogProps.visible = false
    },
      handleDialogOpen(){
       this.dialogProps.visible=true;
      },
  },

  mounted: function() {
    this.$nextTick(() => {
        this.$on('openMemberinfoView', function(id) {
       this.initmemberinfo(id);
        this.dialogProps.action = 'edit'
        this.dialogProps.title = '报告查看'
        this.dialogProps.visible = true
      })
    })
  },
}
</script>

<style>

</style>
